/**$Licence:
 *   Use this however/wherever you like, just don't blame me if it breaks anything.
 *   Copyright (C) 2008 - 2013 xingsheng.zhu@gmail.com All rights reserved.
 */
package com.blazemina.core;

import org.apache.mina.core.service.IoHandler;

import com.blazegame.logging.LoggerFactory;
import com.blazegame.logging.async.AsyncLoggerFactory;
import com.blazemina.command.CommandFactory;
import com.blazemina.command.DefaultJavaCommandFactory;
import com.blazemina.config.BlazeminaConfig;
import com.blazemina.config.entities.CommandPackages;
import com.blazemina.executor.BlazeminaExecutors;
import com.blazemina.executor.RouteHelper;
import com.blazemina.executor.ThreadpoolBlazeminaExecutors;

/**
 * game的配置文件
 * @author JackChu
 * @version 1.0.0 2013-2-22 下午6:02:39
 */
public class GameBlazeminaConfig extends BlazeminaConfig{

	@Override
	public void configLoggerFactory() {
		LoggerFactory.setLoggerFactory(new AsyncLoggerFactory());
	}

	@Override
	public IoHandler configSocketHandler() {
		return new ServerHandler();
	}


	/* (non-Javadoc)
	 * @see com.blazemina.config.BlazeminaConfig#configCommandFactory()
	 */
	@Override
	public CommandFactory configCommandFactory() {
		return new DefaultJavaCommandFactory();
//		return new SpringCommandFactory();
	}

	@Override
	public void configCommandPackages(CommandPackages packages) {
		packages.addPackage("com.game.command", true);
	}

	@Override
	public BlazeminaExecutors configExecutor() {
		return new ThreadpoolBlazeminaExecutors();
	}

	@Override
	public void configExecutorGroup(BlazeminaExecutors executors) {
		executors.addExecutorGroup(ExecutorGroupContants.LOGING_GROUP, 2, false);
	}

	@Override
	public RouteHelper configRouteHelper() {
		return new GameRouteHelper();
	}
	
	

}
